<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
     <button @click="add">登录</button>
     <div v-if="id">
        <input type="text" placeholder="请输入账号">
        <input type="text" placeholder="请输入密码">
        <button>确定</button>
        <button @click="add1">X</button>
     </div>
     
    </div>
</body>
<script src="Vue.js"></script>
<script>
    // 2. 点击登陆 弹出登录框点击X关闭登录框  
    const {createApp,ref} = Vue
    createApp({
        setup(){
        let id = ref(false)
        function add(){
             id.value = true
        }
        function add1(){
            id.value = false
        }
            return{
            id,
            add,
            add1
            }
        }
    }).mount('#app')
</script>
</html>